<?php
/**
 * Created by PhpStorm.
 * Author: QinShuai
 * Email: qinshuai0423@qq.com
 * Date: 2021/6/11
 */


/* @var $this yii\web\View */
/* @var $list yii\web\View */
$controller = $this->context->id;

$this->title = '通用后台管理';
?>
<div class="index">
    <!--搜索-->
    <div class="search">
        <div class="section-body">
            <!--搜索-->
            <el-form label-width="100px" label-position="left">
                <el-row>
                    <el-col :span="6">
                        <el-form-item label="用户名：">
                            <el-input
                                    placeholder="请输入内容"
                                    v-model="searchData.username"
                                    clearable>
                        </el-form-item>
                    </el-col>
                    <el-col :span="10">
                        <el-form-item label="时间：">
                            <el-date-picker
                                    v-model="searchData.times"
                                    type="datetimerange"
                                    range-separator="至"
                                    start-placeholder="开始日期"
                                    end-placeholder="结束日期">
                            </el-date-picker>
                        </el-form-item>
                    </el-col>
                    <el-col :span="3"><el-button type="primary" icon="el-icon-search" @click="searchInput">搜索</el-button></el-col>
                </el-row>
            </el-form>
        </div>
    </div>
    <!--按钮-->
    <div class="button">
        <!--<el-row>
            <el-button>默认按钮</el-button>
            <el-button type="primary">主要按钮</el-button>
            <el-button type="success" @click="handleAdd">添加</el-button>
            <el-button type="info">信息按钮</el-button>
            <el-button type="warning">警告按钮</el-button>
            <el-button type="danger">危险按钮</el-button>
        </el-row>-->
    </div>

    <div class="content">
        <template>
            <!--表格-->
            <el-table
                    :data="tableData"
                    style="width: 100%"
                    height="100%"
                    >
                <el-table-column
                        prop="id"
                        label="ID">
                </el-table-column>
                <el-table-column
                        prop="username"
                        label="用户">
                </el-table-column>
                <el-table-column
                        prop="ip"
                        label="IP">
                </el-table-column>
                <el-table-column
                        prop="os"
                        label="系统">
                </el-table-column>
                <el-table-column
                        prop="browser"
                        label="浏览器">
                </el-table-column>
                <el-table-column
                        prop="url"
                        label="URl">
                </el-table-column>
                <el-table-column
                        prop="module"
                        label="模块">
                </el-table-column>
                <el-table-column
                        prop="controller"
                        label="控制器">
                </el-table-column>
                <el-table-column
                        prop="action"
                        label="方法名">
                </el-table-column>
                <el-table-column
                        prop="method"
                        label="请求方法">
                </el-table-column>
                <el-table-column
                        prop="data"
                        label="请求数据">
                </el-table-column>
               <!-- <el-table-column
                        prop="user_agent"
                        label="请求头">
                </el-table-column>-->
                <el-table-column
                        prop="create_at"
                        label="时间">
                </el-table-column>
            </el-table>
            <!--分页-->
            <el-row type="flex" class="page" justify="end">
                <el-pagination
                        @size-change="handleSizeChange"
                        @current-change="handleCurrentChange"
                        :current-page="currentPage"
                        :page-sizes="pageSizes"
                        :page-size="pageSize"
                        layout="total, sizes, prev, pager, next, jumper"
                        :total="count">
                </el-pagination>
            </el-row>
        </template>
    </div>
</div>
<?php $this->beginBlock('js'); ?>
<script>
    App = {
        data:{
            form: {
                id:'',
                username: '',
                password: '',
                email: '',
                status: '10',
                desc: '',
                role_id:0
            },
            searchData:{
                username:'',
                times: [new Date(2021, 10, 10, 10, 10), new Date(2021, 10, 11, 10, 10)],
            }
        },
        methods: {
            handleSelectionChange(val) {
                console.log(val)
                this.multipleSelection = val;
            },
        }
    }
</script>
<?php $this->endBlock(); ?>
